<%--
Document   : chat
Created on : Apr 8, 2011, 4:48:07 PM
Author     : dimas ciputra cakep
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="jesstalk.Util"%>
<% if (session.getAttribute("username") == null) {
                response.sendRedirect("index.jsp");
            }

//====================================BAGIAN LOG OUT========================================
if(request.getParameter("Logout")!= null) //logout
    {
    session.removeAttribute("username");
    response.sendRedirect("index.jsp");
    }
%>

<html>
    <script type="text/javascript" src="script/ajaxwrap.js"></script>
    <script type="text/javascript" src="script/json2.js"></script>
    <script type="text/javascript" src="script/chatclient.js"></script>
    <script type="text/javascript" src="script/chatcontrollers.js"></script>
    <script type="text/javascript" src="script/listener.js"></script>
    <script type="text/javascript" src="script/roomtree.js"></script>
    <script type="text/javascript" src="script/roomtab.js"></script>
    <link href="style/chat.css" rel="stylesheet" type="text/css">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <head>
        <script type="text/javascript">
            var name = "<%= session.getAttribute("username")%>";
            init(name, "<%= Util.getBaseUrl(request) %>");
        </script>

        <title>Chat World</title>
    </head>
    <div class="wrap">
        <body>
            Hello, <%= session.getAttribute("username")%>

            <table id="header">
                <tr>
                    <td>
                        &nbsp;&nbsp;jesstalk - just talk to your hand
                    </td>
                    <td>
                        <a href="chat.jsp?Logout=1" id ="logout"> Log Out</a>
                    </td>
                </tr>
            </table>

            <table id="center">
                <tr>
                    <td>
                        <div id="rightinroom">
                            <span id="menuroom">
                                &nbsp;&nbsp;Room
                            </span>
                            <div id="roomTrees">
                            </div>
                        </div>
                        <div id="rightinfriend">
                            <span id="menuroom">
                                &nbsp;&nbsp;Friends
                            </span>
                            <div id="listFriend">
                                
                            </div>
                        </div>
                    </td>
                    <td>
                        <div id="tabchat">
                            <div id="dummytab">
                            </div>  
                        </div>
                        <div id="centerin">
                            <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
                            <div id="outchat">
                            </div>
                        </div>
                        <div id="inputchat">
                            <form action="javascript:checkInputUser('<%= session.getAttribute("username")%>')" method="">
                                <input type="text" id="chattext"/>
                        </form>
                        </div>
                    </td>
                    <td>
                        <div id="leftinroom">
                            <span id="menuroom">
                                &nbsp;&nbsp;User in room 
                            </span>
                            <div id="listuser">
                                
                            </div>
                        </div>
                    </td>

                </tr>
            </table>

            <table id="footer">
                <tr>
                <script type="text/javascript">
                </script>
                <td>
                    <center>
                        Created for Internet Programming Assignment, Bandung Institute of Technology
                        <br/>
                        Copyright 2011
                        <br/>
                        <a href="http://www.facebook.com/sir.dip">Dimas Tri Ciputra</a>
                        <a href="http://www.facebook.com/profile.php?id=1052323993">Ecky Putrady</a>
                        <a href="http://www.facebook.com/Gunawan.Robert">Robert Gunawan</a>
                    </center>
                </td>
                </tr>
            </table>
        </body>
    </div>
</html>
